home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-1.iso / comm / ftp4w24b.zip / ftp4w.vb < prev    next >
Text File  |  1995-01-16  |  6KB  |  115 lines

  1. ' ***************************************************************
  2. '
  3. '
  4. '
  5. '    FTP4W.DLL % lib "FTP4W.DLL" (Version 1.2)
  6. '
  7. '
  8. '                                   By Ph. Jounin (SNCF 71-26-12)
  9. '                                        Internet ark@ifh.sncf.fr
  10. '                                        Thanks to Santanu Lahiri
  11. ' Header written by Bram Buitendijk <Bram.Buitendijk@library.KNAW.NL>
  12. ' ***************************************************************
  13.  
  14.  
  15. ' -----------------------------------------------------------
  16. ' ASCII or binary tranfser
  17. Global Const TYPE_A = 65 ' "A", ascii
  18. Global Const TYPE_I = 73 ' "I", binary
  19.  
  20. ' -----------------------------------------------------------
  21. '              Return codes of FTP functions
  22. ' -----------------------------------------------------------
  23.  
  24. ' success
  25. Global Const FTPERR_OK = 0             ' succesful function
  26. Global Const FTPERR_ENTERPASSWORD = 1  ' userid need a password
  27. Global Const FTPERR_ACCOUNTNEEDED = 2  ' user/pass OK but account required
  28. Global Const FTPERR_CANCELBYUSER = -1  ' Transfer aborted by user FtpAbort
  29.  
  30. ' user's or programmer's Errors
  31. Global Const FTPERR_INVALIDPARAMETER = 1000  ' Error in parameters
  32. Global Const FTPERR_SESSIONUSED = 1001       ' User has already a FTP session
  33. Global Const FTPERR_NOTINITIALIZED = 1002    ' FtpInit has not been callED
  34. Global Const FTPERR_NOTCONNECTED = 1003      ' User is not connected to a server
  35. Global Const FTPERR_CANTOPENFILE = 1004      ' can not open specified file
  36. Global Const FTPERR_CANTWRITE = 1005         ' can't write to file (disk full?)
  37. Global Const FTPERR_NOACTIVESESSION = 1006   ' FtpRelease without FtpInit
  38. Global Const FTPERR_STILLCONNECTED = 1007    ' FtpRelease without any Close
  39. Global Const FTPERR_SERVERCANTEXECUTE = 1008 ' file action not taken
  40. Global Const FTPERR_LOGINREFUSED = 1009      ' Server rejects usrid/passwd
  41. Global Const FTPERR_NOREMOTEFILE = 1010      ' server can not open file
  42. Global Const FTPERR_TRANSFERREFUSED = 1011   ' Host refused the transfer
  43. Global Const FTPERR_WINSOCKNOTUSABLE = 1012  ' A winsock.DLL ver 1.1 is required
  44. Global Const FTPERR_CANTCLOSE = 1013         ' Close failed (cmd is in progress) 
  45.  
  46. ' TCP errors
  47. Global Const FTPERR_UNKNOWNHOST = 2001     ' can not resolve host adress
  48. Global Const FTPERR_NOREPLY = 2002         ' host does not send an answer
  49. Global Const FTPERR_CANTCONNECT = 2003     ' Error during connection
  50. Global Const FTPERR_CONNECTREJECTED = 2004 ' host has no FTP server
  51. Global Const FTPERR_SENDREFUSED = 2005     ' can't send data(network down)
  52. Global Const FTPERR_DATACONNECTION = 2006  ' connection on data-port failed
  53. Global Const FTPERR_TIMEOUT = 2007         ' timeout occured
  54.  
  55. ' FTP errors
  56. Global Const FTPERR_UNEXPECTEDANSWER = 3001 ' answer was not expected
  57. Global Const FTPERR_CANNOTCHANGETYPE = 3002 ' host rejects the TYPE command
  58.  
  59. ' Resource errors
  60. Global Const FTPERR_CANTCREATEWINDOW = 5002 ' Insufficent free resources
  61. Global Const FTPERR_INSMEMORY = 5003        ' Insuffisent Heap memory
  62. Global Const FTPERR_CANTCREATESOCKET = 5004 ' no more socket
  63. Global Const FTPERR_CANTBINDSOCKET = 5005   ' bind is not succesful
  64.  
  65. ' ****************************************************************
  66. '
  67. '                    P R O T O T Y P E S
  68. '
  69. ' ****************************************************************
  70.  
  71. ' Utility functions
  72.  
  73. ' Change default parameters
  74. Declare Function FtpSetVerboseMode% Lib "FTP4W.DLL" (ByVal bVerboseMode As Integer, ByVal hVerboseWnd As Integer, ByVal wMsg As Integer)
  75. Declare Function FtpBytesTransfered Lib "FTP4W.DLL" () As Long
  76. Declare Function FtpBytesToBeTransfered Lib "FTP4W.DLL" () As Long
  77. Declare Sub FtpSetDefaultTimeOut Lib "FTP4W.DLL" (ByVal nTo_in_sec As Integer)
  78. Declare Sub FtpSetDefaultPort Lib "FTP4W.DLL" (ByVal nDefPort As Integer)
  79. Declare Sub FtpSetAsynchronousMode Lib "FTP4W.DLL" ()
  80. Declare Sub FtpSetSynchronousMode Lib "FTP4W.DLL" ()
  81. Declare Function FtpIsAsynchronousMode Lib "FTP4W.DLL" () As Integer
  82. Declare Sub FtpSetNewDelay Lib "FTP4W.DLL" (ByVal x As Integer)
  83. Declare Sub FtpSetNewSlices Lib "FTP4W.DLL" (ByVal x As Integer, ByVal y As Integer)
  84.  
  85. ' Init functions
  86. Declare Function FtpRelease% Lib "FTP4W.DLL" ()
  87. Declare Function FtpInit% Lib "FTP4W.DLL" (ByVal hParentWnd As Integer)
  88.  
  89. ' Connection
  90. Declare Function FtpLogin% Lib "FTP4W.DLL" (ByVal szHost As String, ByVal szUser As String, ByVal szPasswd As String, ByVal hParentWnd As Integer, ByVal wMsg As Integer)
  91. Declare Function FtpOpenConnection% Lib "FTP4W.DLL" (ByVal szHost As String)
  92. Declare Function FtpCloseConnection% Lib "FTP4W.DLL" ()
  93. Declare Function FtpLocalClose% Lib "FTP4W.DLL" ()
  94.  
  95. ' authentification
  96. Declare Function FtpSendUserName% Lib "FTP4W.DLL" (ByVal szUserName As String)
  97. Declare Function FtpSendPasswd% Lib "FTP4W.DLL" (ByVal szPasswd As String)
  98.  
  99. ' commands
  100. Declare Function FtpHelp% Lib "FTP4W.DLL" (ByVal szArg As String, ByVal szBuf As String, ByVal uBufSize As Integer)
  101. Declare Function FtpCWD% Lib "FTP4W.DLL" (ByVal szPath As String)
  102. Declare Function FtpQuote% Lib "FTP4W.DLL" (ByVal szCmd As String, ByVal szReplyBuf As String, ByVal uBufSize As Integer)
  103. Declare Function FtpSetType% Lib "FTP4W.DLL" (ByVal cType As Integer)
  104.  
  105. ' file transfer
  106. Declare Function FtpAbort% Lib "FTP4W.DLL" ()
  107. Declare Function FtpSendFile% Lib "FTP4W.DLL" (ByVal szLocal As String, ByVal szRemote As String, ByVal cType As Integer, ByVal bNotify As Integer, ByVal hParentWnd As Integer, ByVal wMsg As Integer)
  108. Declare Function FtpRecvFile% Lib "FTP4W.DLL" (ByVal szRemote As String, ByVal szLocal As String, ByVal cType As Integer, ByVal bNotify As Integer, ByVal hParentWnd As Integer, ByVal wMsg As Integer)
  109. Declare Function FtpGetFileSize Lib "FTP4W.DLL" () As Long
  110.  
  111. ' Directory
  112. Declare Function FtpDir% Lib "FTP4W.DLL" (ByVal szDef As String, ByVal szLocalFile As String, ByVal bLongDir As Integer, ByVal hParentWnd As Integer, ByVal wMsg As Integer)
  113.  
  114.  
  115.